<?php session_start();

if($_POST)
{
	if($_POST['username'] == 'test' && $POST['password'] == 'test')
    {
    	$data['success'] = true;
		$data['redirect'] = 'profile.php';
		
    }
    else
    {
    	$data['success'] = false;
		$data['message'] = 'Invalid username or password.';
    }
	
	echo json_encode($data);
}

?>

<?=$errorMessage?>